const http = require('http')
const fs = require('fs')

const server = http.createServer()

//请求对象req
server.on('request',(req,res)=>{
    console.log('我的服务被请求了');
    console.log('url',req.url);
    console.log('method',req.method);
})

//启动服务
server.listen(8080,()=>{
    console.log('server running at http://127.0.0.1:8080');
})